<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Kullanici Details</f:facet>


        <s:decorate id="ad" template="layout/display.xhtml">
            <ui:define name="label">Ad</ui:define>
            <h:outputText value="#{kullaniciHome.instance.ad}"/>
        </s:decorate>

        <s:decorate id="kod" template="layout/display.xhtml">
            <ui:define name="label">Kod</ui:define>
            <h:outputText value="#{kullaniciHome.instance.kod}"/>
        </s:decorate>

        <s:decorate id="parola" template="layout/display.xhtml">
            <ui:define name="label">Parola</ui:define>
            <h:outputText value="#{kullaniciHome.instance.parola}"/>
        </s:decorate>
        
        <s:decorate id="authorizedPeopleField" template="layout/display.xhtml">
			<ui:define name="label">Atanmış Roller</ui:define>			 
			 <rich:dataList var="rol" value="#{kullaniciHome.instance.rols}" rows="5" type="disc" title="Atanmış Roller">
                <h:outputText value="#{rol.kod} - #{rol.ad}"/>
        	</rich:dataList>
		</s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/KullaniciEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty kullaniciFrom ? 'KullaniciList' : kullaniciFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax" rendered="#{kullaniciHome.instance.firma == null || authenticator.isAdmin()}">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Firma</h:panelGroup>
        </f:facet>
    <div class="association" id="firmaParent">

        <h:outputText value="There is no firma associated with this kullanici."
                   rendered="#{kullaniciHome.instance.firma == null}"/>

        <rich:dataTable var="_firma"
                   value="#{kullaniciHome.instance.firma}"
                rendered="#{kullaniciHome.instance.firma != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="firmaTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_firma.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_firma.ad}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Adres</f:facet>
                <h:outputText value="#{_firma.adres}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Eposta</f:facet>
                <h:outputText value="#{_firma.eposta}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_firma.kod}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Telefon</f:facet>
                <h:outputText value="#{_firma.telefon}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Vergino</f:facet>
                <h:outputText value="#{_firma.vergino}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Webadresi</f:facet>
                <h:outputText value="#{_firma.webadresi}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Mersisno</f:facet>
                <h:outputText value="#{_firma.mersisno}"/>
            </h:column>            
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewfirma"
                     value="View"
                      view="/Firma.xhtml">
                    <f:param name="firmaId"
                           value="#{_firma.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
